﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmepModelInterface.h"
#include "IMepGenericElementType.h"
#include "IGmepConstDefinition.h"

namespace gcmp
{
    class UniIdentity;
}

namespace gmep
{
    struct SystemClassificationHash
    {
        std::size_t operator()(const MEPSystemClassification& key) const
        {
            return std::hash<Int32>()((Int32)key);
        }
    };

    /// \brief 系统类型接口定义
    class GMEP_MODEL_INTERFACE_EXPORT IMepSystemType :public IMepGenericElementType
    {
        DEFINE_CAST_DERIVED(gmep::IMepSystemType, gmep::IMepGenericElementType)
    public:
        virtual ~IMepSystemType() {}

    public:
        /// \brief 获取、设置当前系统类型的系统分类
        virtual MEPSystemClassification GetSystemClassification()const = 0;
        virtual bool SetSystemClassification(MEPSystemClassification systemClassification) = 0;

        /// \brief 设置和获取项目配置管理中对应的系统类型数据记录的唯一GUID，一般用于查询项目配置管理中的某个系统类型是否已经加载到当前工作单元
        virtual const gcmp::UniIdentity& GetProjectSettingRecordId() const = 0;
        virtual bool SetProjectSettingRecordId(const gcmp::UniIdentity& guidString) = 0;

        /// \brief 获取、设置当前系统类型的显示样式
        virtual gcmp::ElementId GetGraphicsStyleId() const =0;
        virtual bool SetGraphicsStyleId(const gcmp::ElementId &newId)=0;

        /// \brief 获取系统代号
        /// \return 返回系统代号
        virtual std::wstring GetCode() const = 0;

        /// \brief 设置系统代号
        virtual void SetCode(const std::wstring &code) = 0;

        /// \brief 获取系统类型所属的专业
        /// \return 返回系统类型所属的专业
        virtual gmep::MEPDisciplineId GetMepDiscipline() const;

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();
    };
}

